<{include file="Public/top.html" }>
	</head>
	<body>
		<div id="warpper">
            <div class="content">
                <div class="location">用户列表</div>
                <div class="filedSet" style="padding-bottom: 0;">
                    <div class="search">
                        <form action="" id="searchForm" method="get"  class="ui-form reportForm">
                            <input name="m" type="hidden" value="<{$module}>">
                            <input name="c" type="hidden" value="<{$controller}>">
                            <input name="a" type="hidden" value="<{$action}>">

                            <input name="p" id="page" type="hidden" value="<{$page|default:1}>">
                            <input name="limit" id="limit" type="hidden" value="<{$limit|default:10}>">
                            <input name="ofield" id="ofield" type="hidden" value="<{$ofield}>">
                            <input name="otype"  id="otype"  type="hidden" value="<{$otype}>">

                            <div class="ui-form-item inline-block">
                                <label class="ui-label">ID或昵称</label>
                                <input name="userNameOrNickName" value="<{$userNameOrNickName}>" type="text" class="ui-text bg-text keyword" />
                            </div>
                            <div class="ui-form-item inline-block">
                                <label class="ui-label">用户姓名</label>
                                <input name="realName" type="text" value="<{$realName}>" class="ui-text bg-text keyword" />
                            </div>
                            <div class="ui-form-item inline-block">
                                <label class="ui-label">手机号</label>
                                <input name="phone" type="text" value="<{$phone}>" class="ui-text bg-text keyword" />
                            </div>
                            <div class="ui-form-item inline-block">
                                <label class="ui-label">时间段</label>
                                <input name="beginTime" value="<{$beginTime}>" type="text" id="beginTime" class="ui-text"/>
                            </div>
                            <div class="ui-form-item inline-block">
                                <label class="ui-label">-&nbsp;</label>
                                <input name="endTime" value="<{$endTime}>" type="text" id="endTime" class="ui-text"/>
                            </div>
                            <div class="ui-form-item inline-block">
                                <label class="ui-label">用户标签</label>
                                <select name="tag" class="ui-select">
                                    <option value="0">全部</option>
                                    <{html_options options=$tag selected=$selectedTag}>
                                </select>
                            </div>
                            <div class="ui-form-item inline-block">
                                <label class="ui-label">用户状态</label>
                                <select name="status" class="ui-select" style="width: 100px;">
                                    <{html_options options=$status selected=$selectedStatus}>
                                </select>
                            </div>
                            <div class="ui-form-item inline-block">
                                <button type="submit" class="ui-button" onclick="LayerShow()">搜索</button>
                            </div>
                        </form>
                    </div>
                </div>                 
                <!--表格内容-->
                <div class="mainGrid">
                    <table class="ui-table ui-body">
                        <thead>
                            <tr>              
                                <th class="pct10"><a href="javascript:void(0)" onclick="changeOrder(1)">ID</a><span class="<{if $ofield eq 1}><{$otype}><{/if}>"></span></th>
                                <th class="pct15"><a href="javascript:void(0)" onclick="changeOrder(2)">来源</a><span class="<{if $ofield eq 2}><{$otype}><{/if}>"></span></th>
                                <th class="pct10"><a href="javascript:void(0)" onclick="changeOrder(4)">昵称</a><span class="<{if $ofield eq 4}><{$otype}><{/if}>"></span></th>
                                <th class="pct10"><a href="javascript:void(0)" onclick="changeOrder(5)">用户姓名</a><span class="<{if $ofield eq 5}><{$otype}><{/if}>"></span></th>
                                <th class="pct12"><a href="javascript:void(0)" onclick="changeOrder(6)">手机号</a><span class="<{if $ofield eq 6}><{$otype}><{/if}>"></span></th>
                                <th class="pct9"><a href="javascript:void(0)" onclick="changeOrder(7)">积分</a><span class="<{if $ofield eq 7}><{$otype}><{/if}>"></span></th>
                                <th class="pct9"><a href="javascript:void(0)" onclick="changeOrder(8)">会员等级</a><span class="<{if $ofield eq 8}><{$otype}><{/if}>"></span></th>
                                <th class="pct12"><a href="javascript:void(0)" onclick="changeOrder(9)">注册时间</a><span class="<{if $ofield eq 9}><{$otype}><{/if}>"></span></th>
                                <th class="pct12 last-col">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <{foreach from=$list item=one}>
                            <tr>
                                <td><{$one.uid}></td>
                                <td><{$one.regFrom}></td>
                                <td><{$one.nickname}></td>
                                <td><{$one.realName}></td>
                                <td><{$one.bindPhone|default:'未绑定'}></td>
                                <td><{$one.point}></td>
                                <td><{$one.level}></td>
                                <td><{$one.regTime|date_format:"%Y-%m-%d"}></td>
                                <td class="ta_l">
                                    <div class="handler">
                                        <a   href="javascript:void(0)" onclick="showDetail(<{$one.uid}>)">详情</a>
                                        <span class="sep">|</span>
                                        <a href="<{u('User/edit?uid='|cat:$one.uid)}>" onclick="LayerShow();">修改</a>
                                    </div>
                                </td>
                            </tr>
                        <{/foreach}>
                        </tbody>
                    </table>
                </div>
                <div class="pagination">
                    <!--描述：分页-->
                    <{include file="Public/page.html" }>
                </div>
            </div>
		</div>



        <div style="display:none;">
            <!--详情-->
            <div id="details">
                <div class="form-box border0">
                    <form action="" class="ui-form" id="addManagerForm">
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">ID：</label>
                            <input type="text" class="ui-text ui-text-2" id="uid" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">会员等级：</label>
                            <input type="text" class="ui-text ui-text-2" id="level" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">来源：</label>
                            <input type="text" class="ui-text ui-text-2" id="regFrom"/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">会员经验：</label>
                            <input type="text" class="ui-text ui-text-2" id="EXP" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">用户昵称：</label>
                            <input type="text" class="ui-text ui-text-2" id="nickname" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">积分：</label>
                            <input type="text" class="ui-text ui-text-2" id="point" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">用户姓名：</label>
                            <input type="text" class="ui-text ui-text-2" id="realName" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">余额：</label>
                            <input type="text" class="ui-text ui-text-2" id="money" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">手机号码：</label>
                            <input type="text" class="ui-text ui-text-2" id="bindPhone"/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">消费总额：</label>
                            <input type="text" class="ui-text ui-text-2" id="consumeMoney" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">用户标签：</label>
                            <input type="text" class="ui-text ui-text-2" id="userTag" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">邮箱：</label>
                            <input type="text" class="ui-text ui-text-2" id="email" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">用户状态：</label>
                            <input type="text" class="ui-text ui-text-2" id="userStatus" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">性别：</label>
                            <input type="text" class="ui-text ui-text-2" id="sex" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">注册IP：</label>
                            <input type="text" class="ui-text ui-text-2" id="regIP"/>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">出生日期：</label>
                            <input type="text" class="ui-text ui-text-2" id="birthday" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">最后登录IP：</label>
                            <input type="text" class="ui-text ui-text-2" id="lastLoginIP" />
                        </div>
                        <div class="ui-form-item inline-block">
                            <div style="padding-bottom:10px;">
                                <label class="ui-label ui-label-2">关注时间：</label>
                                <input type="text" class="ui-text ui-text-2" id="WX_attentionTime" />
                            </div>
                            <div style="padding-bottom:10px;">
                                <label class="ui-label ui-label-2">注册时间：</label>
                                <input type="text" class="ui-text ui-text-2" id="regTime" />
                            </div>
                            <div>
                                <label class="ui-label ui-label-2">最后登陆时间：</label>
                                <input type="text" class="ui-text ui-text-2" id="lastLoginTime"/>
                            </div>
                        </div>
                        <div class="ui-form-item inline-block">
                            <label class="ui-label ui-label-2">详细地址：</label>
                            <textarea class="ui-textarea" style="width:150px; height:95px;" id="address"></textarea>
                        </div>
                    </form>
                </div>
            </div>
        </div>


        <{include file="Public/foot.html" }>
        <script src="Public/Admin/js/dialog-min.js"></script>

        <script>
            datePickter('beginTime','endTime',1);
            function showDetail(uid){
                ajaxGetUserData(uid,function(){
                    var details = dialog({
                        title: '用户详情',
                        width: 700,
                        content: $("#details"),
                        onshow: function(){
                            //$("#details form")[0].reset();
                        },
                    });
                    details.showModal();
                });
            }

            function ajaxGetUserData(uid,func){
                $.getJSON("./api.php?m=Api&c=index&a=getUser",{uid:uid}, function(data){
                    if(data.status!=0){
                        layer.msg("数据获取失败，请稍后重试或联系管理员解决！");
                    }else{
                        var d=data.data;
                        $('#uid').val(d.uid);
                        $('#level').val(d.level);
                        $('#regFrom').val(d.regFrom);
                        $('#EXP').val(d.EXP);
                        $('#nickname').val(d.nickname);
                        $('#point').val(d.point);
                        $('#realName').val(d.realName);
                        $('#bindPhone').val(d.bindPhone);
                        $('#consumeMoney').val(d.consumeMoney);
                        $('#money').val(d.money);
                        $('#userTag').val(d.userTag);
                        $('#email').val(d.email);
                        $('#userStatus').val(d.userStatus);
                        $('#sex').val(d.sex);
                        $('#regIP').val(d.regIP);
                        $('#regTime').val(d.regTime);
                        $('#birthday').val(d.birthday);
                        $('#WX_attentionTime').val(d.WX_attentionTime);
                        $('#lastLoginIP').val(d.lastLoginIP);
                        $('#lastLoginTime').val(d.lastLoginTime);
                        $('#address').val(d.address);
                        if(func){func()};


                    }
                });
            }

		</script>
	</body>
</html>
